function addUserDialog(callback = Function()) {
    const $form = $(`
        <form class="mask-account">
            <div style="margin: 0">
                <span class="mask-account-tit">手机号</span>
                <span class="input-select"><input type="text" name="phone" placeholder="请输入手机号" /></span>
            </div>
            <div>
                <span class="mask-account-tit">邮箱</span>
                <span class="input-select"><input type="text" name="email" placeholder="请输入邮箱" /></span>
            </div>
            
            <div>
                <span class="mask-account-tit">用户名</span>
                <span class="input-select"><input type="text" name="userName" placeholder="请输入用户名" /></span>
            </div>
            
            <div>
                <span class="mask-account-tit">性别</span>
                <span data-select="sex"></span>
            </div>
            
            <div>
                <span class="mask-account-tit">头像</span>
                <div class="input-select" style="border: 0;padding: 0">
                    <input type="hidden" name="avatarUrl">
                </div>
            </div>
            
            <div>
                <span class="mask-account-tit"><sub style="color: red;">*</sub> 密码</span>
                <span class="input-select"><input type="password" name="password" placeholder="请输入密码" /></span>
            </div>
            
            <div>
                <span class="mask-account-tit"><sub style="color: red;">*</sub> 确认密码</span>
                <span class="input-select"><input type="password" name="rePassword" placeholder="请确认密码" /></span>
            </div>
           
        </form>
    `)

    const $sexSel = $.getSelect("sex", [
        {name: "请选择", value: ""},
        {name: "男", value: 1},
        {name: "女", value: 2},
    ]);
    $form.find('[data-select="sex"]').replaceWith($sexSel);

    const $avatarUrlInput = $form.find('input[name="avatarUrl"]');

    $avatarUrlInput.after(getUploadImgWidget({
        maxCount: 1,
        callback(urlList) {
            $avatarUrlInput.val(urlList.join(","))
        }
    }));

    const $dialogWidget = $.dialog($form, {
        title: "新增用户",
        width: "600px",
        ok: () => {
            const data = $.getFormData($form);

            const {password, rePassword} = data;
            if (password && !rePassword) {
                $.toast("请确认密码");
            } else {
                if (password !== rePassword) {
                    return $.toast("确认密码和密码不一致");
                }
            }


            addUser(data, res => {
                const {Code, Message} = res;
                if (Code !== 10000) {
                    return $.toast(Message);
                }

                $dialogWidget.remove();
                $.toast("添加成功");
                callback();
            })

            return false;
        }
    })


    function addUser(param, callback = Function()) {
        return $.sApi({
            data: param,
            url: "/api/User/addUser"
        }, callback)
    }


}